/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2022. All rights reserved.
 * Description: hisi sasv2 driver Vendor Hooks
 */

#ifdef CONFIG_NETBIOS_HISI_SAS_SPEC

#ifndef HISI_SAS_HWV2_EXT_H
#define HISI_SAS_HWV2_EXT_H
#include "hisi_sas.h"
void trace_sas_hisi_get_phy_ctl_base(struct hisi_hba *hisi_hba,
									u32 *sas_phy_ctrl);
int trace_sas_hisi_spec_dt_config(struct hisi_hba *hisi_hba, int i);
void trace_sas_hisi_error_record(struct hisi_hba *hisi_hba,
					struct hisi_sas_slot *slot, __le32 dw0,
					__le32 dw1, __le32 dw3, u32 *error_info);
void trace_sas_hisiv2_set_phy_rate(struct hisi_hba *hisi_hba, int i,
								u32 *prog_phy_link_rate);
void trace_sas_hisi_enable_int_spec(struct hisi_hba *hisi_hba);
void trace_sas_hisi_routine_test(struct platform_device *pdev);
void trace_sas_hisi_phy_spec_config(struct hisi_hba *hisi_hba, int i);
void trace_sas_hisi_phy_complete(struct hisi_sas_phy *phy);
#endif

#else

struct hisi_hba;
struct hisi_sas_slot;
struct platform_device;
struct hisi_sas_phy;
#define TP_PROTO(args...)	args
#define DECLARE_HISAS_NOP(name, proto, args)	\
	static inline void trace_##name(proto)		\
	{ }

DECLARE_HISAS_NOP(sas_hisi_get_phy_ctl_base,
	TP_PROTO(struct hisi_hba *hisi_hba, u32 *sas_phy_ctrl),
	TP_ARGS(hisi_hba, sas_phy_ctrl));

static inline int trace_sas_hisi_spec_dt_config(struct hisi_hba *hisi_hba, int i)
{
	return 0;
}

DECLARE_HISAS_NOP(sas_hisi_error_record,
	TP_PROTO(struct hisi_hba *hisi_hba, struct hisi_sas_slot *slot,
	__le32 dw0, __le32 dw1, __le32 dw3, u32 *error_info),
	TP_ARGS(hisi_hba, slot, dw0, dw1, dw3, error_info));

DECLARE_HISAS_NOP(sas_hisiv2_set_phy_rate,
	TP_PROTO(struct hisi_hba *hisi_hba, int i, u32 *prog_phy_link_rate),
	TP_ARGS(hisi_hba, i, prog_phy_link_rate));

DECLARE_HISAS_NOP(sas_hisi_enable_int_spec,
	TP_PROTO(struct hisi_hba *hisi_hba),
	TP_ARGS(hisi_hba));

DECLARE_HISAS_NOP(sas_hisi_routine_test,
	TP_PROTO(struct platform_device *pdev),
	TP_ARGS(pdev));

DECLARE_HISAS_NOP(sas_hisi_phy_spec_config,
	TP_PROTO(struct hisi_hba *hisi_hba, int i),
	TP_ARGS(hisi_hba, i));

DECLARE_HISAS_NOP(sas_hisi_phy_complete,
	TP_PROTO(struct hisi_sas_phy *phy),
	TP_ARGS(phy));
#endif
